﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;


namespace ITAMngApp.TkMng.TaskForm
{
   
    public partial class AddNewProject : Form
    {
        //文件夹选择窗口
        private FolderBrowserDialog m_folderBrowserDialog = null;

        private GMngMainForm m_ParentForm = null;

        public AddNewProject(GMngMainForm mainForm)
        {
            InitializeComponent();
            m_folderBrowserDialog = new FolderBrowserDialog();
            m_ParentForm = mainForm;
        }

        private void BtnSelectSavePath_Click(object sender, EventArgs e)
        {
            if (m_folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show(m_folderBrowserDialog.SelectedPath);
                this.SavePathTextBox.Text = m_folderBrowserDialog.SelectedPath;
            }
        }

        private void BtnConfirm_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            if (Directory.Exists(this.SavePathTextBox.Text))
            {
                this.Close();
            }
            else
            {
                MessageBox.Show("文件夹路径错误！");
                this.SavePathTextBox.Text = "";
                this.Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
